package com.gzh.teaching.model.vo;

import com.gzh.core.util.NumericHelper;
import com.gzh.teaching.service.dto.AddUserIn;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @Author guanzh
 * @Date 2022/1/27 17:05
 * @Description
 */
@Setter
@Getter
@ToString
public class AddUserParam {
    private List<String> list;

    private String courseId;

    public AddUserIn paramToIn(Integer userId) {
        AddUserIn in = new AddUserIn();
        in.setList(this.list.stream().map(t->NumericHelper.toInteger(t)).collect(Collectors.toList()));
        in.setCourseId(NumericHelper.toInteger(this.courseId));
        in.setUserId(userId);
        return in;
    }
}
